/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
import com.igorov.efficientsoft.business.gestorcliente.GestorCliente;
import com.igorov.efficientsoft.services.ClienteDTO;
import java.util.Iterator;
import java.util.List;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
/**
 *
 * @author igorov
 */
public class PruebaClientes {
    public static void main(String[] args){
        ApplicationContext ctx = new ClassPathXmlApplicationContext("/applicationContext.xml");
        GestorCliente gestorCliente = (GestorCliente) ctx.getBean("gestorCliente");
        
        List<ClienteDTO> clienteDTOs = gestorCliente.buscarClientes("ivonne");
        for (Iterator<ClienteDTO> it = clienteDTOs.iterator(); it.hasNext();) {
            ClienteDTO clienteDTO = it.next();
            System.out.println("Cliente: ");
            System.out.println("Id: " + clienteDTO.getCodigo());
            System.out.println("Nombres: " + clienteDTO.getNombres());
            System.out.println("Ap paterno: " + clienteDTO.getApellidoPaterno());
            System.out.println("");
        }
    }
}
